package com.ruoyi.produce.report.produceAnalysis.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.List;

/**
 * 生产分析
 * 主表生产计划情况
 * @author lsy 2021.12.31
 */
@Data
@NoArgsConstructor
public class ProduceAnalysis {
    /**
     * 生产计划编号
     */
    private String planSelfId;

    /**
     * 产品基本信息
     */
    private String produceId; //产品编号
    private String produceName; //产品编号
    private String baseCategoryId; //类别编号
    private String baseCategoryName; //类别名称
    private String baseUnitId; //计量单位编号
    private String baseUnit; //计量单位名称
    private String produceSpecs; //产品规格
    private String produceBrand; //产品品牌

    /**
     * 完成情况
     */
    private String completionStatus; //完成状态 0-未完成、1-已完成

    private Double planSelfNumber; //计划完成数量

    private Double completedNumber; //已完成数量

    /**
     * 时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.sql.Timestamp startTime; //开始时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private java.sql.Timestamp predictedFinishingTime; //预计完成时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp endTime; //结束时间

    private long productionTime; //生产时间
    private long advanceTime; //提前完成时间(正数为提前完成天数、负数为逾期天数)

    /**
     * 加工单情况
     */
    private List<ProduceAnalysisList> produceAnalysisLists;

    public ProduceAnalysis(String planSelfId, String produceId, String produceName, String baseCategoryId, String baseCategoryName, String baseUnitId, String baseUnit, String produceSpecs, String produceBrand, String completionStatus, double planSelfNumber, double completedNumber) {
        this.planSelfId = planSelfId;
        this.produceId = produceId;
        this.produceName = produceName;
        this.baseCategoryId = baseCategoryId;
        this.baseCategoryName = baseCategoryName;
        this.baseUnitId = baseUnitId;
        this.baseUnit = baseUnit;
        this.produceSpecs = produceSpecs;
        this.produceBrand = produceBrand;
        this.completionStatus = completionStatus;
        this.planSelfNumber = planSelfNumber;
        this.completedNumber = completedNumber;
    }
}
